package com.ding.pojo;

import org.json.JSONException;
import org.json.JSONObject;

public class Message {
	String target;
	String message;
	
	public static Message jsonToMessage(JSONObject json) throws JSONException {
		Message m = new Message();
		m.setMessage(json.getString("message"));
		m.setTarget(json.getString("target"));
		return m;
	}
	
	public String getTarget() {
		return target;
	}
	public void setTarget(String target) {
		this.target = target;
	}
	
	public String getMessage() {
		return message;
	}
	
	public void setMessage(String message) {
		this.message = message;
	}
	
	@Override
	public String toString() {
		return message+"   to   "+target;
	}
	
}
